package YAPserver.mods.list;

import java.util.ArrayList;

import YAPserver.mods.ModBehaviour;

class ModList{

	private ArrayList<ModBehaviour> mods = new ArrayList<ModBehaviour>();
	
	/**
	 * Adds a modBehaviour with a certain chance to the list of mods.
	 * @param chance is an Integer bigger or equal to 1. The larger chance is the higher the probability
	 * that this ModBehaviour will be chosen.
	 * @param mod is the specified ModBehaviour to be added.
	 */
	public void add(int chance, ModBehaviour mod){
		for(int i=0; i<chance; i++){
			mods.add(mod);
		}
	}
	/**
	 * Returns the i'th modBehaviour in the list.
	 * @param i index of the specified modBehaviour
	 * @return the modBehaviour at index i
	 */
	public ModBehaviour get(int i) {
		return mods.get(i);
	}

	/**
	 * Returns the length of this list.
	 * @return the length of this list.
	 */
	public int size() {
		return mods.size();
	}
}
